// const Updateform = {
//     template:"#Updateform",
//     data() {
//         return {
//             duration: ["1", "2", "3", "4"],
//             durationShowAndSend: "",
//             typeProps: [],
//             contactProps: [],
//             locationProps: [],
//             schedule: {
//                 date: "",
//                 time: "",
//                 contact_id: "",
//                 location: "",
//                 type: "",
//                 topic: "",
//                 title: "",
//                 duration: "",
//             },
//         }
//     },
//     methods: {
//         typeFor() {
//             axios({
//                 url: "/ScheduleBlock/typeFor",
//                 method: "post",
//                 header: {},
//             }).then((res) => {
//                 this.typeProps = res.data
//                 console.log(res.data)
//                 console.log(this.typeProps)
//                 console.log("success")
//             }).catch(err => {
//                 console.log("failed")
//             })
//         },
//         contactFor() {
//             axios({
//                 url: "/ScheduleBlock/contactFor",
//                 method: "post",
//                 header: {},
//             }).then((res) => {
//                 this.contactProps = res.data
//                 console.log(this.contactProps)
//                 console.log(res.data)
//                 console.log("success")
//             }).catch(err => {
//                 console.log("failed")
//             })
//         },
//         locationFor() {
//             axios({
//                 url: "/ScheduleBlock/locationFor",
//                 method: "post",
//                 header: {},
//             }).then((res) => {
//                 this.locationProps = res.data
//                 console.log(this.locationProps)
//                 console.log(res.data)
//                 console.log("success")
//             }).catch(err => {
//                 console.log("failed")
//             })
//         },
//         updateScheduleData(id) {
//
//             // if (this.schedule.contact_id == "Jhon") {
//             //     this.schedule.contact_id = 1
//             // } else if (this.contact_id == "Luna") {
//             //     this.schedule.contact_id = 2
//             // } else if (this.contact_id == "LUORUI") {
//             //     this.schedule.contact_id = 3
//             //     console.log("contact is " + this.contact_id)
//             // }
//             //
//             // if (this.schedule.type == "Depertment") {
//             //     this.schedule.type = 1
//             // } else if (this.schedule.type == "Company") {
//             //     this.schedule.type = 2
//             // } else if (this.schedule.type == "Org") {
//             //     this.schedule.type = 3
//             // }
//             //
//             // if (this.schedule.location == "ABuilding") {
//             //     this.schedule.location = 1
//             // } else if (this.schedule.location == "BBuilding") {
//             //     this.schedule.location = 2
//             // } else if (this.schedule.location == "CBuilding") {
//             //     this.schedule.location = 3
//             // }
//             console.log(this.schedule)
//             this.schedule.duration = this.durationShowAndSend
//             const urlParams = new URLSearchParams()
//             urlParams.append("schedule", JSON.stringify(this.schedule))
//             urlParams.append("idR", id)
//             axios.post("/ScheduleBlock/updateScheduleData", urlParams).then((res => {
//                 if (res.data == true) {
//                     alert("Success")
//                 } else {
//                     alert("Failed")
//                 }
//                 console.log("success")
//             })).catch(err => {
//                 alert("Failed")
//                 console.log("failed")
//             });
//         },
//     },
//     mounted() {
//         this.typeFor()
//         this.locationFor()
//         this.contactFor()
//     },
// }

const MyNotes = {
    template: "#MyNotes",
}

const Affairs = {
    template: "#Affairs",
    data() {
        return {
            dateStart: "",
            dateEnd: "",
            keyword: "",
            contact: "",
            type: "",
            currentPage: 1,
            pageSize: 5,
            userId: "",
            totalCount: "",
            pageCount: "",
            location: "",
            affairs: [],
            typeProps: [],
            contactProps: [],
            locationProps: [],
        }
    },
    methods: {
        showAllAffair() {
            this.userId = $('input[name="getUserID"]').val()
            // if (this.contact == "Jhon") {
            //     this.contact =
            //     console.log("contact is " + this.contact)
            // } else if (this.contact == "Luna") {
            //     this.contact = 10
            //     console.log("contact is " + this.contact)
            // } else if (this.contact == "LUORUI") {
            //     this.contact = 11
            //     console.log("contact is " + this.contact)
            // }
            //
            // if (this.type == "个人级") {
            //     this.type = 9
            // } else if (this.type == "部门级") {
            //     this.type = 10
            // } else if (this.type == "公司级") {
            //     this.type = 11
            // }
            //
            // if (this.location == "ABuilding") {
            //     this.location = 1
            // } else if (this.location == "BBuilding") {
            //     this.location = 2
            // } else if (this.location == "CBuilding") {
            //     this.location = 3
            // }
            // console.log("currentPage is before" + this.currentPage)
            // console.log("pageSize is before" + this.pageSize)
            // console.log("dateStart is before" + this.dateStart)
            // console.log("dateEnd is before" + this.dateEnd)
            // console.log("contact is before" + this.contact)
            // console.log("type is before" + this.type)
            // console.log("location is before" + this.location)
            // console.log("keyword is before" + this.keyword)
            // alert("type is "+ this.type)
            // alert("location is "+ this.location )
            axios({
                url: "/ScheduleBlock/queryAllAffairs",
                method: "post",
                header: {},
                params: {
                    currentPage: this.currentPage,
                    pageSize: this.pageSize,
                    dateStart: this.dateStart,
                    dateEnd: this.dateEnd,
                    keyword: this.keyword,
                    contact: this.contact,
                    location: this.location,
                    type: this.type,
                    userId: this.userId,
                }
            }).then((res) => {
                console.log(res.data)
                this.affairs = res.data
                let date = new Date(res.data.time)
                console.log(this.affairs)

                // console.log("currentPage is after" + this.currentPage)
                // console.log("pageSize is after" + this.pageSize)
                // console.log("dateStart is after" + this.dateStart)
                // console.log("dateEnd is after" + this.dateEnd)
                // console.log("contact is after" + this.contact)
                // console.log("type is after" + this.type)
                // console.log("location is after" + this.location)
                // console.log("keyword is after" + this.keyword)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
            console.log("getTotalCount function is on")
            console.log(this.keyword)
            this.getTotalCount()
        },
        typeFor() {
            axios({
                url: "/ScheduleBlock/typeFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.typeProps = res.data
                console.log(res.data)
                console.log(this.typeProps)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        contactFor() {
            axios({
                url: "/ScheduleBlock/contactFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.contactProps = res.data
                console.log(this.contactProps)
                console.log(res.data)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        locationFor() {
            axios({
                url: "/ScheduleBlock/locationFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.locationProps = res.data
                console.log(this.locationProps)
                console.log(res.data)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        reloadPage() {
            this.dateStart = ""
            this.dateEnd = ""
            this.keyword = ""
            this.contact = ""
            this.location = ""
            this.type = ""
            this.showAllAffair()
        },
        getTotalCount() {
            console.log("totalCount enter" + this.keyword)
            // let postData = new URLSearchParams()
            // postData.append('keyword', this.keyword)
            axios({
                url: "/ScheduleBlock/queryAffairsCount",
                post: "post",
                header: {},
                params: {
                    dateStart: this.dateStart,
                    dateEnd: this.dateEnd,
                    keyword: this.keyword,
                    contact: this.contact,
                    typeName02: this.location,
                    typeName01: this.type,
                    userId: this.userId,
                }
            }).then((res) => {
                this.totalCount = res.data
                this.pageCount = Math.ceil(this.totalCount / this.pageSize)
                console.log(this.pageCount)
                console.log("this totalCount is " + this.totalCount)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        getHomePage() {
            this.currentPage = 1
            console.log("home:" + this.currentPage)
            this.showAllAffair()
        },
        getLastPage() {
            this.currentPage--
            console.log("last before:" + this.currentPage)
            if (this.currentPage <= 1) {
                this.currentPage = 1
            }
            console.log("Last:" + this.currentPage)
            this.showAllAffair()
        },
        getNextPage() {
            this.currentPage++
            if (this.currentPage >= (Math.ceil((this.totalCount / this.pageSize)))) {
                this.currentPage = (Math.ceil((this.totalCount / this.pageSize)))
            }
            console.log("next:" + this.currentPage)
            console.log(this.currentPage)
            this.showAllAffair()
        },
        getEnd() {
            this.currentPage = (Math.ceil((this.totalCount / this.pageSize)));
            console.log("totalPage is " + (Math.ceil((this.totalCount / this.pageSize))))
            this.showAllAffair()
        },
        getDeletedData(id) {
            // const urlIdentifyId = new URLSearchParams()
            // urlIdentifyId.append('idR', id)


            layer.confirm('确定要删除吗？',
                {
                    btn: ['删除', '取消'],
                    yes: function () {
                        axios.delete("/ScheduleBlock/deleteData", {params: {idR: id}}).then((res) => {
                            if (res.data == true) {
                                // alert("delete success")
                                layer.alert("删除成功")
                                window.location.reload()
                            } else {
                                layer.alert("删除失败")
                            }

                            console.log("success")
                            this.showAllAffair()
                        }).catch(err => {
                            console.log("failed")

                        })
                    }
                })
        },
        queryUpdatedTarget(id) {
            console.log("queryUpdatedTarget is in")
            axios({
                url: "/ScheduleBlock/queryUpdatedTarget",
                method: "post",
                params: {
                    idR: id,
                },
                header: {},
            }).then((res) => {
                console.log("data is" + res.data)
                this.schedule = res.data
                console.log("this schedule is " + this.schedule)
                console.log("success")
                console.log("success, ready jump to update page")
                //To convert the object data to json
                const json = encodeURIComponent(JSON.stringify(this.schedule))
                console.log(json)
                const URLSend = "/ScheduleBlock/schedule/update?schedule=" + json;
                // to make window.location.href to send a post request
                const html = "<form action='" + URLSend + "' method='post' name='formSend' style='display:none'>"
                    + "</form>";
                document.write(html);
                document.formSend.submit();
            }).catch(err => {
                console.log("failed")
            })
        }
    },
    mounted() {
        this.showAllAffair()
        this.contactFor()
        this.typeFor()
        this.locationFor()
        this.getTotalCount()
    },

}

const Schedulemanagement = {
    template: "#ScheduleManagement",
    data() {
        return {
            typeProps: [],
            contactProps: [],
            locationProps: [],
            date: "",
            time: "",
            type: "",
            location: "",
            topic: "",
            contact: "",
            title: "",
            // year: "",
            duration: ["1", "2", "3", "4"],
            durationShowAndSend: "",
            userId: "",
        }
    },
    methods: {
        addData() {
            /*date*/
            this.userId = $('input[name="getUserID"]').val()

            let yearR = new Date(this.date).getFullYear();
            let monthR = new Date(this.date).getMonth() + 1;
            if (monthR < 10) {
                monthR = "0" + monthR;
            }
            let dayR = new Date(this.date).getDate();
            if (dayR < 10) {
                dayR = "0" + dayR;
            }
            let dateS = yearR + "-" + monthR + "-" + dayR
            /*time*/
            let timeS = this.time + ":00"
            console.log("this time is " + timeS)
            /*duration*/
            let durationS = this.durationShowAndSend


            let properties = [dateS, timeS, this.topic, this.type, this.title, this.contact, this.location, durationS]
            for (let i = 0; i < properties.length; i++) {
                if (properties[i] == "") {
                    layer.alert("添加信息必须完善")
                    return

                }
            }
            axios({
                url: "/ScheduleBlock/addData",
                header: {},
                method: 'post',
                params: {
                    date: dateS,
                    time: timeS,
                    topic: this.topic,
                    type: this.type,
                    title: this.title,
                    contactName: this.contact,
                    location: this.location,
                    duration: durationS,
                    user_id: this.userId,
                    // myCalendar2: "",
                }
            }).then((res) => {

                if (res.data == true) {
                    layer.alert("添加成功")
                    this.$router.push("/Affairs")
                } else {
                    layer.alert("添加失败")
                }
                console.log("Insert function success")
                // window.location.reload()
            }).catch(err => {
                console.log("Insert function failed")

            })
        },
        typeFor() {
            axios({
                url: "/ScheduleBlock/typeFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.typeProps = res.data
                console.log(res.data)
                console.log(this.typeProps)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        contactFor() {
            axios({
                url: "/ScheduleBlock/contactFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.contactProps = res.data
                console.log(this.contactProps)
                console.log(res.data)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        locationFor() {
            axios({
                url: "/ScheduleBlock/locationFor",
                method: "post",
                header: {},
            }).then((res) => {
                this.locationProps = res.data
                console.log(this.locationProps)
                console.log(res.data)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        // scheduleInitialized() {
        //     //Calendar2(Start)
        //     const calendar2 = document.querySelector('#my-calendar2');
        //
        //     this.myCalendar2 = new TavoCalendar(calendar2, {
        //         date: this.year,
        //         selected: [],
        //         //range_select: true
        //     })
        //
        //     calendar2.addEventListener('calendar-select', (ev) => {
        //         console.log(this.myCalendar2.getSelected())
        //         $("input[name='dateOption']").val(this.myCalendar2.getSelected())
        //     })
        //
        //     calendar2.addEventListener('calendar-change', (ev) => {
        //         const m = this.myCalendar2.getFocusMonth();
        //
        //     })
        //     //Calendar2(End)
        // },
        // nextYear() {
        //     let currentPrefixYearByNumber = parseInt(this.myCalendar2.getFocusYear().substring(2, 4))
        //     currentPrefixYearByNumber++;
        //     console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //     this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //     $("#my-calendar2").html("")
        //     this.scheduleInitialized()
        //
        // },
        // lastYear() {
        //     let currentPrefixYearByNumber = parseInt(this.myCalendar2.getFocusYear().substring(2, 4))
        //     currentPrefixYearByNumber--;
        //
        //     console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //
        //     this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //     $("#my-calendar2").html("")
        //     this.scheduleInitialized()
        // },
        // currentDate() {
        //     const calendar2 = document.querySelector('#my-calendar2');
        //     let date = new Date();
        //     let year = date.getFullYear();
        //     let month = date.getMonth()
        //     if (month < 10) {
        //         month = "0" + month;
        //     }
        //     let day = date.getDate();
        //     if (day < 10) {
        //         day = "0" + day;
        //     }
        //     alert(day)
        //     alert(month)
        //     let generateKey = year + '-' + month + '-' + day;
        //     $("#my-calendar2").html("")
        //     this.myCalendar2 = new TavoCalendar(calendar2, {
        //         date: generateKey,
        //         selected: [],
        //         //range_select: true
        //     })
        // }
    },
    mounted() {
        // this.scheduleInitialized()
        this.contactFor()
        this.typeFor()
        this.locationFor()
    }
}

const Schedule = {

    template: "#Schedule",
    data() {
        return {
            attrs: [
                {
                    key: "use",
                    highlight: 'blue',
                    dates: [],
                },
                {
                    key: "today",
                    highlight: 'orange',
                    dates: new Date(),
                }
            ],
            dateList: [],
            datePassedList: [],
            dateProcessingNum: [],
            today: this.formatDate(),
            toggleToCheckDate: true,
            rangeAndSingle: false,
            totalAffairsCount: "",
            AffairsCountForMonth: "",
            promptMessage: "",
            userId: $('input[name="getUserID"]').val(),
            range: {
                start: "",
                end: "",
            },
            simulatedRange: {
                start: new Date(),
                end: new Date(),
            },
            travelLeaveCount: "",
            travelLeaveCountCheck: true,
            showTaskPrompt: false,
            travelLeaveShow: false,
            toggleSimulatedCalendar: true,
            leaveApplyCount: "",
            inThreeDays: [],
            // //
            // // year: "",
            // // myCalendar1: "",
            //

            // taskTensionPrompt: "",

        }
    },
    // props: ["value"],
    methods: {
        queryAllDateFromAffairs() {
            axios({
                url: "/ScheduleBlock/queryAllDateFromAffairs",
                header: {},
                params: {
                    idR: this.userId
                },
                method: "post",
            }).then((res) => {
                this.dateList = res.data
                // // claimed array
                // let datePassed = [];
                // let dateProcessing = [];
                // console.log("All date is "+res.data)
                // // processing rollback data stats
                // for(let i =0; i<res.data.length;i++){
                //     if(res.data[i].state==1){
                //         datePassed.push(res.data[i])
                //     }else if(res.data[i].state==0){
                //         dateProcessing.push(res.data[i])
                //     }
                // }
                // // to loop the elements
                // console.log("the datePassed is "+datePassed)
                // // to get how much elements in dateProcessing
                // console.log("dateProcessing is".length)
                //
                // // to judge if there are elements in dataPassed array
                // if(datePassed.length>0){
                //     this.datePassedList = datePassed[0]
                // }else{
                //     this.datePassedList = []
                // }
                //
                // //claiming the array and length
                // this.dateProcessingNum = dateProcessing.length


                this.attrs[0].dates = this.dateList

                console.log(this.attrs[0].dates)
                this.compareTheMonth(res.data)
                console.log("success")
            }).catch(err => {
                console.log("failed")
            })
        },
        scheduleInitialized() {
            //Calendar1(Start)
            if (this.toggleToCheckDate == true) {
                this.attrs[0].dates = this.dateList;

            } else if (this.toggleToCheckDate == false) {
                this.attrs[0].dates = [];

            } else {
                this.attrs[0].dates = this.dateList;

            }
            //Calendar1(End)
        },
        ShowMarkedDate() {
            this.toggleToCheckDate = !this.toggleToCheckDate
            this.showTaskPrompt = false
            $("#my-calendar1").html("")
            this.scheduleInitialized()
        },
        formatDate() {
            let date = new Date();
            let formatDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
            return formatDate
        },
        getAffairsCount() {
            this.userId = $('input[name="getUserID"]').val()
            let UrlData = new URLSearchParams()
            UrlData.append("userId", this.userId)
            axios.post("/ScheduleBlock/queryAffairsCount", UrlData).then((res) => {
                this.totalAffairsCount = res.data
                console.log("Success")
            }).catch(err => {
                console.log("Failed")
            })
        },
        compareTheMonth(trans) {
            let dateList = trans;
            console.log(dateList)

            function compareNumber() {
                if (new Date().getMonth() + 1 <= 9) {
                    return Number('0' + (new Date().getMonth() + 1))
                } else if (new Date().getMonth() + 1 > 9) {
                    return new Date().getMonth() + 1
                }
            }

            for (let i in dateList) {
                if (Number(dateList[i].substring(5, 7)) == compareNumber()) {
                    this.AffairsCountForMonth++
                }
            }
            console.log("this.AffairsCountForMonth is " + this.AffairsCountForMonth)
        },
        toggleThemesChange() {
            this.toggleThemes = !this.toggleThemes
            layer.alert(this.toggleThemes)
        },
        toggleRangeCalendar() {
            this.rangeAndSingle = !this.rangeAndSingle
            this.travelLeaveShow = false
            if (this.rangeAndSingle == true) {
                this.promptMessage = "日历为单日模式，可以开始查看您的事务了";
            } else if (this.rangeAndSingle == false) {
                this.promptMessage = "日历为出差模式，可以查看出差时间段";
            }

        },
        queryLeaveRequest() {
            this.userId = $('input[name="getUserID"]').val()
            let URLParams = new URLSearchParams();
            URLParams.append("idR", this.userId);
            axios.post("/ScheduleBlock/queryLeaveRequest", URLParams).then(res => {

                // claimed array
                let datePassed = [];
                let dateProcessing = [];

                console.log("All date is " + res.data)
                // processing rollback data stats
                console.log(res.data[0].state)
                for (let i = 0; i < res.data.length; i++) {
                    if (res.data[i].state == 1) {
                        datePassed.push(res.data[i])
                    } else if (res.data[i].state == 0) {
                        dateProcessing.push(res.data[i])
                    }
                }
                // to loop the elements
                console.log("the datePassed is " + datePassed.length)
                // to get how much elements in dateProcessing
                console.log("dateProcessing is " + dateProcessing)
                console.log("dateProcessing is" + dateProcessing.length)

                // to judge if there are elements in dataPassed array
                if (datePassed.length > 0) {
                    this.range.start = new Date(datePassed[0].beginTime);
                    this.range.end = new Date(datePassed[0].endTime)
                } else {
                    this.datePassedList = []
                    this.range.start = ""
                    this.range.end = ""
                }

                //claiming the array and length
                this.dateProcessingNum = dateProcessing.length
                //
                // for (let i in this.rangeDate) {
                //     console.log("begin time is " + this.rangeDate[i].beginTime + "the endTime is " + this.rangeDate[i].endTime)
                // }

                console.log("this.range.start" + this.range.start);
                console.log("this.range.end" + this.range.end)
                console.log("Success")
            }).catch(err => {
                console.log("Error")
            })
        },
        queryLeaveRequestCount() {
            this.userId = $('input[name="getUserID"]').val()
            let URLParams = new URLSearchParams();
            URLParams.append("idR", this.userId);
            axios.post("/ScheduleBlock/queryLeaveRequestCount", URLParams).then(res => {
                this.travelLeaveCount = res.data
                console.log("Success")
            }).catch(err => {
                console.log("Failed")

            })
        },
        queryLeaveApplyCount() {
            axios({
                url: "/ScheduleBlock/queryLeaveApplyCount",
                method: "post",
                params: {
                    idR: this.userId,
                }
            }).then(res => {
                this.leaveApplyCount = res.data
                console.log("Success")
            }).catch(err => {
                console.log("Failed")

            })
        },
        toggleTravelLeaveCountCheck() {
            this.travelLeaveCountCheck = !this.travelLeaveCountCheck
        },
        toggleShowTaskPrompt() {
            this.showTaskPrompt = !this.showTaskPrompt
        },
        toggleTravelLeaveShow() {
            this.travelLeaveShow = !this.travelLeaveShow
        },
        // computedAffairsForWeeks() {
        //     let yearR = new Date().getFullYear();
        //     let monthR = new Date().getMonth() + 1;
        //
        //     let dayR = new Date().getDate();
        //
        //     let today = yearR + "-" + monthR + "-" + dayR
        //     let threeDays = []
        //
        //     for (let i = 0; i < 3; i++) {
        //         dayR = dayR + 1
        //
        //
        //         if (dayR > 30) {
        //             monthR = monthR + 1
        //             dayR = 1
        //             if (dayR < 10) {
        //                 dayR = "0" + dayR;
        //             }
        //         }
        //         if (monthR < 10) {
        //             monthR = "0" + monthR;
        //         }
        //         threeDays.push(yearR + "-" + monthR + "-" + dayR)
        //          monthR = new Date().getMonth() + 1;
        //     }
        //
        //     console.log("threeDays is " + threeDays)
        //
        //
        //     for (let i = 0; i < threeDays.length; i++) {
        //         for (let j = 0; j < this.dateList.length; j++) {
        //             if (threeDays[i] == this.dateList[j]) {
        //                 this.inThreeDays.push(this.dateList[j])
        //             }
        //         }
        //     }
        //
        //     console.log("this.dateList"+this.dateList)
        // }
        // simulatedCalendar(){
        //
        //     this.simulatedRange.start = new Date("2022-03-05")
        //     this.simulatedRange.end = new Date("2022-03-10")
        //     this.toggleSimulatedCalendar=!this.toggleSimulatedCalendar
        // },
        // closeSimulatedCalendar(){
        //     alert("this.simulatedRange.start"+this.simulatedRange.start)
        //     alert("this.simulatedRange.end"+this.simulatedRange.end)
        //     this.simulatedRange.start = new Date()
        //     this.simulatedRange.end = new Date()
        //     this.toggleSimulatedCalendar=!this.toggleSimulatedCalendar
        // }

    },
    // computed: {
    //     dates() {
    //         return this.days.map(day => day.date);
    //     },
    //     attributes() {
    //         return this.dates.map(date => ({
    //             highlight: true,
    //             dates: date,
    //         }));
    //     },
    // },
    //     taskTension(list) {
    //         let flag;
    //         let count;
    //         let dateList = list;
    //
    //         if (dateList.length > 10) {
    //             this.taskTensionPrompt = "适中，请合理安排工作，并按时完成"
    //         } else if (dateList.length <=10) {
    //             this.taskTensionPrompt = "您的工作弹性较高"
    //         }
    //         // for(let i = 0;i<dateList.length;i++){
    //         //     if(dataList[i+1]-dateList[i]==1){
    //         //         count++;
    //         //     }
    //         // }
    //         //
    //         // if(count>=5){
    //         //     flag="低"
    //         // }else if(count>=5){
    //         //
    //         // }
    //     },
    // onDayClick(day) {
    //     const idx = this.days.findIndex(d => d.id === day.id);
    //     if (idx >= 0) {
    //         this.days.splice(idx, 1);
    //     } else {
    //         this.days.push({
    //             id: day.id,
    //             date: day.date,
    //         });
    //     }
    // },
    //     nextYear() {
    //         let currentPrefixYearByNumber = parseInt(this.myCalendar1.getFocusYear().substring(2, 4))
    //         currentPrefixYearByNumber++;
    //         console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
    //         this.year = "20" + currentPrefixYearByNumber + "-01-01"
    //         $("#my-calendar1").html("")
    //         this.scheduleInitialized()
    //
    //     },
    //     lastYear() {
    //         let currentPrefixYearByNumber = parseInt(this.myCalendar1.getFocusYear().substring(2, 4))
    //         currentPrefixYearByNumber--;
    //
    //         console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
    //
    //         this.year = "20" + currentPrefixYearByNumber + "-01-01"
    //         $("#my-calendar1").html("")
    //         this.scheduleInitialized()
    //     },
    //     currentDate() {
    //         window.location.reload()
    //     },

    mounted() {
        this.queryLeaveRequest();
        this.queryAllDateFromAffairs();
        this.getAffairsCount()
        this.toggleRangeCalendar();
        this.queryLeaveRequestCount();
        this.formatDate();
        this.queryLeaveApplyCount();
        this.computedAffairsForWeeks();
        // this.dateFilter()
        // this.getAffairsCount()
        // this.taskTension()
    },
    created() {

    }

}

const paths = [
    {
        path: "/Schedule",
        name: "Schedule",
        component: Schedule,
    },
    {
        path: "/Schedulemanagement",
        name: "Schedulemanagement",
        component: Schedulemanagement
    },
    {
        path: "/Affairs",
        name: "/Affairs",
        component: Affairs,
    },
    {
        path: "/MyNotes",
        name: "MyNotes",
        component: MyNotes,
    }
]

var router = new VueRouter({
    routes: paths,
})

var vm = new Vue({
    el: "#block01",
    router: router,
    data: {
        // ScheduleShow: false,
        // ScheduleManagementShow: false,
        // AffairsShow: true,
        // NotesShow: false,
        // UpdateFormShow: false,
        typeFor: [],
    },
    components: {
        // "Schedule": {
        //     template: "#Schedule",
        // data() {
        //     return {
        //         dateList: [],
        //         year: "",
        //         myCalendar1: "",
        //         myCalendar1: "",
        //         toggleToCheckDate: false,
        //         affairsCount: "",
        //     }
        // },
        // methods: {
        //     scheduleInitialized() {
        //         //Calendar1(Start)
        //         if (this.toggleToCheckDate == true) {
        //             this.myCalendar1 = new TavoCalendar('#my-calendar1', {
        //                 date: this.year,
        //                 selected: this.dateList,
        //             })
        //
        //         } else if (this.toggleToCheckDate == false) {
        //             this.myCalendar1 = new TavoCalendar('#my-calendar1', {
        //                 date: this.year,
        //                 selected: [],
        //             })
        //
        //         } else {
        //             this.myCalendar1 = new TavoCalendar('#my-calendar1', {
        //                 date: this.year,
        //                 selected: this.dateList,
        //             })
        //
        //         }
        //
        //         //Calendar1(End)
        //     },
        //     queryAllDateFromAffairs() {
        //         axios({
        //             url: "/ScheduleBlock/queryAllDateFromAffairs",
        //             header: {},
        //             method: "post",
        //         }).then((res) => {
        //             this.dateList = res.data
        //             console.log(this.dateList)
        //             console.log(res.data)
        //             this.scheduleInitialized()
        //             console.log("success")
        //         }).catch(err => {
        //             console.log("failed")
        //         })
        //     },
        //     nextYear() {
        //         let currentPrefixYearByNumber = parseInt(this.myCalendar1.getFocusYear().substring(2, 4))
        //         currentPrefixYearByNumber++;
        //         console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //         this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //         $("#my-calendar1").html("")
        //         this.scheduleInitialized()
        //
        //     },
        //     lastYear() {
        //         let currentPrefixYearByNumber = parseInt(this.myCalendar1.getFocusYear().substring(2, 4))
        //         currentPrefixYearByNumber--;
        //
        //         console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //
        //         this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //         $("#my-calendar1").html("")
        //         this.scheduleInitialized()
        //     },
        //     ShowMarkedDate() {
        //         this.toggleToCheckDate = !this.toggleToCheckDate
        //         $("#my-calendar1").html("")
        //         this.scheduleInitialized()
        //     },
        //     currentDate() {
        //         window.location.reload()
        //     },
        //     getAffairsCount() {
        //         axios.post("/ScheduleBlock/queryAffairsCount").then((res) => {
        //             this.affairsCount = res.data
        //             console.log("Success")
        //         }).catch(err => {
        //             console.log("Failed")
        //         })
        //     }
        // },
        // mounted() {
        //     this.queryAllDateFromAffairs()
        //     this.getAffairsCount()
        // }
        // },
        // "schedulemanagement": {
        //     template: "#ScheduleManagement",
        //     data() {
        //         return {
        //             typeProps: [],
        //             contactProps: [],
        //             locationProps: [],
        //             date: "",
        //             time: "",
        //             type: "",
        //             location: "",
        //             topic: "",
        //             contact: "",
        //             title: "",
        //             // year: "",
        //             duration: ["1", "2", "3", "4"],
        //             durationShowAndSend: "",
        //         }
        //     },
        //     methods: {
        //         addData() {
        //             /*date*/
        //             let yearR = new Date(this.date).getFullYear();
        //             let monthR = new Date(this.date).getMonth();
        //             if (monthR < 10) {
        //                 monthR = "0" + monthR;
        //             }
        //             let dayR = new Date(this.date).getDate();
        //             if (dayR < 10) {
        //                 dayR = "0" + dayR;
        //             }
        //             let dateS = yearR + "-" + monthR + "-" + dayR
        //             /*time*/
        //             let timeS = this.time + ":00"
        //             console.log("this time is " + timeS)
        //             /*duration*/
        //             let durationS = this.durationShowAndSend
        //
        //
        //             let properties = [dateS, timeS, this.topic, this.type, this.title, this.contact, this.location, durationS]
        //             for (let i = 0; i < properties.length; i++) {
        //                 if (properties[i] == "") {
        //                     alert("添加信息必须完善")
        //                 }
        //             }
        //             axios({
        //                 url: "/ScheduleBlock/addData",
        //                 header: {},
        //                 method: 'put',
        //                 params: {
        //                     date: dateS,
        //                     time: timeS,
        //                     topic: this.topic,
        //                     type: this.type,
        //                     title: this.title,
        //                     contactName: this.contact,
        //                     location: this.location,
        //                     duration: durationS,
        //                     // myCalendar2: "",
        //                 }
        //             }).then((res) => {
        //                 if (res.data == true) {
        //                     alert("success")
        //                 } else {
        //                     alert("failed")
        //                 }
        //                 console.log("success")
        //                 // window.location.reload()
        //             }).catch(err => {
        //                 console.log("failed")
        //
        //             })
        //         },
        //         typeFor() {
        //             axios({
        //                 url: "/ScheduleBlock/typeFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.typeProps = res.data
        //                 console.log(res.data)
        //                 console.log(this.typeProps)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         contactFor() {
        //             axios({
        //                 url: "/ScheduleBlock/contactFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.contactProps = res.data
        //                 console.log(this.contactProps)
        //                 console.log(res.data)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         locationFor() {
        //             axios({
        //                 url: "/ScheduleBlock/locationFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.locationProps = res.data
        //                 console.log(this.locationProps)
        //                 console.log(res.data)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         // scheduleInitialized() {
        //         //     //Calendar2(Start)
        //         //     const calendar2 = document.querySelector('#my-calendar2');
        //         //
        //         //     this.myCalendar2 = new TavoCalendar(calendar2, {
        //         //         date: this.year,
        //         //         selected: [],
        //         //         //range_select: true
        //         //     })
        //         //
        //         //     calendar2.addEventListener('calendar-select', (ev) => {
        //         //         console.log(this.myCalendar2.getSelected())
        //         //         $("input[name='dateOption']").val(this.myCalendar2.getSelected())
        //         //     })
        //         //
        //         //     calendar2.addEventListener('calendar-change', (ev) => {
        //         //         const m = this.myCalendar2.getFocusMonth();
        //         //
        //         //     })
        //         //     //Calendar2(End)
        //         // },
        //         // nextYear() {
        //         //     let currentPrefixYearByNumber = parseInt(this.myCalendar2.getFocusYear().substring(2, 4))
        //         //     currentPrefixYearByNumber++;
        //         //     console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //         //     this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //         //     $("#my-calendar2").html("")
        //         //     this.scheduleInitialized()
        //         //
        //         // },
        //         // lastYear() {
        //         //     let currentPrefixYearByNumber = parseInt(this.myCalendar2.getFocusYear().substring(2, 4))
        //         //     currentPrefixYearByNumber--;
        //         //
        //         //     console.log("currentPrefixYearByNumber is" + currentPrefixYearByNumber)
        //         //
        //         //     this.year = "20" + currentPrefixYearByNumber + "-01-01"
        //         //     $("#my-calendar2").html("")
        //         //     this.scheduleInitialized()
        //         // },
        //         // currentDate() {
        //         //     const calendar2 = document.querySelector('#my-calendar2');
        //         //     let date = new Date();
        //         //     let year = date.getFullYear();
        //         //     let month = date.getMonth()
        //         //     if (month < 10) {
        //         //         month = "0" + month;
        //         //     }
        //         //     let day = date.getDate();
        //         //     if (day < 10) {
        //         //         day = "0" + day;
        //         //     }
        //         //     alert(day)
        //         //     alert(month)
        //         //     let generateKey = year + '-' + month + '-' + day;
        //         //     $("#my-calendar2").html("")
        //         //     this.myCalendar2 = new TavoCalendar(calendar2, {
        //         //         date: generateKey,
        //         //         selected: [],
        //         //         //range_select: true
        //         //     })
        //         // }
        //     },
        //     mounted() {
        //         // this.scheduleInitialized()
        //         this.contactFor()
        //         this.typeFor()
        //         this.locationFor()
        //     }
        // },
        // "Affairs": {
        //     template: "#Affairs",
        //     data() {
        //         return {
        //             dateStart: "",
        //             dateEnd: "",
        //             keyword: "",
        //             contact: "",
        //             type: "",
        //             currentPage: 1,
        //             pageSize: 5,
        //             totalCount: "",
        //             pageCount: "",
        //             location: "",
        //             affairs: [],
        //             typeProps: [],
        //             contactProps: [],
        //             locationProps: [],
        //         }
        //     },
        //     methods: {
        //         showAllAffair() {
        //             // if (this.contact == "Jhon") {
        //             //     this.contact =
        //             //     console.log("contact is " + this.contact)
        //             // } else if (this.contact == "Luna") {
        //             //     this.contact = 10
        //             //     console.log("contact is " + this.contact)
        //             // } else if (this.contact == "LUORUI") {
        //             //     this.contact = 11
        //             //     console.log("contact is " + this.contact)
        //             // }
        //             //
        //             // if (this.type == "个人级") {
        //             //     this.type = 9
        //             // } else if (this.type == "部门级") {
        //             //     this.type = 10
        //             // } else if (this.type == "公司级") {
        //             //     this.type = 11
        //             // }
        //             //
        //             // if (this.location == "ABuilding") {
        //             //     this.location = 1
        //             // } else if (this.location == "BBuilding") {
        //             //     this.location = 2
        //             // } else if (this.location == "CBuilding") {
        //             //     this.location = 3
        //             // }
        //             // console.log("currentPage is before" + this.currentPage)
        //             // console.log("pageSize is before" + this.pageSize)
        //             // console.log("dateStart is before" + this.dateStart)
        //             // console.log("dateEnd is before" + this.dateEnd)
        //             // console.log("contact is before" + this.contact)
        //             // console.log("type is before" + this.type)
        //             // console.log("location is before" + this.location)
        //             // console.log("keyword is before" + this.keyword)
        //             axios({
        //                 url: "/ScheduleBlock/queryAllAffairs",
        //                 method: "post",
        //                 header: {},
        //                 params: {
        //                     currentPage: this.currentPage,
        //                     pageSize: this.pageSize,
        //                     dateStart: this.dateStart,
        //                     dateEnd: this.dateEnd,
        //                     keyword: this.keyword,
        //                     contact: this.contact,
        //                     location: this.location,
        //                     type: this.type,
        //                 }
        //             }).then((res) => {
        //                 console.log(res.data)
        //                 this.affairs = res.data
        //                 let date = new Date(res.data.time)
        //                 console.log(this.affairs)
        //                 this.contact = "";
        //                 this.type = "";
        //                 this.location = "";
        //                 // console.log("currentPage is after" + this.currentPage)
        //                 // console.log("pageSize is after" + this.pageSize)
        //                 // console.log("dateStart is after" + this.dateStart)
        //                 // console.log("dateEnd is after" + this.dateEnd)
        //                 // console.log("contact is after" + this.contact)
        //                 // console.log("type is after" + this.type)
        //                 // console.log("location is after" + this.location)
        //                 // console.log("keyword is after" + this.keyword)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //             console.log("getTotalCount function is on")
        //             console.log(this.keyword)
        //             this.getTotalCount()
        //         },
        //         typeFor() {
        //             axios({
        //                 url: "/ScheduleBlock/typeFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.typeProps = res.data
        //                 console.log(res.data)
        //                 console.log(this.typeProps)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         contactFor() {
        //             axios({
        //                 url: "/ScheduleBlock/contactFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.contactProps = res.data
        //                 console.log(this.contactProps)
        //                 console.log(res.data)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         locationFor() {
        //             axios({
        //                 url: "/ScheduleBlock/locationFor",
        //                 method: "post",
        //                 header: {},
        //             }).then((res) => {
        //                 this.locationProps = res.data
        //                 console.log(this.locationProps)
        //                 console.log(res.data)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         reloadPage() {
        //             this.dateStart = ""
        //             this.dateEnd = ""
        //             this.keyword = ""
        //             this.contact = ""
        //             this.location = ""
        //             this.type = ""
        //             this.showAllAffair()
        //         },
        //         getTotalCount() {
        //             console.log("totalCount enter" + this.keyword)
        //             // let postData = new URLSearchParams()
        //             // postData.append('keyword', this.keyword)
        //             axios({
        //                 url: "/ScheduleBlock/queryAffairsCount",
        //                 post: "post",
        //                 header: {},
        //                 params: {
        //                     dateStart: this.dateStart,
        //                     dateEnd: this.dateEnd,
        //                     keyword: this.keyword,
        //                     contact: this.contact,
        //                     typeName02: this.location,
        //                     typeName01: this.type,
        //                 }
        //             }).then((res) => {
        //                 this.totalCount = res.data
        //                 this.pageCount = Math.ceil(this.totalCount / this.pageSize)
        //                 console.log(this.pageCount)
        //                 console.log("this totalCount is " + this.totalCount)
        //                 console.log("success")
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         },
        //         getHomePage() {
        //             this.currentPage = 1
        //             console.log("home:" + this.currentPage)
        //             this.showAllAffair()
        //         },
        //         getLastPage() {
        //             this.currentPage--
        //             console.log("last before:" + this.currentPage)
        //             if (this.currentPage <= 1) {
        //                 this.currentPage = 1
        //             }
        //             console.log("Last:" + this.currentPage)
        //             this.showAllAffair()
        //         },
        //         getNextPage() {
        //             this.currentPage++
        //             if (this.currentPage >= (Math.ceil((this.totalCount / this.pageSize)))) {
        //                 this.currentPage = (Math.ceil((this.totalCount / this.pageSize)))
        //             }
        //             console.log("next:" + this.currentPage)
        //             console.log(this.currentPage)
        //             this.showAllAffair()
        //         },
        //         getEnd() {
        //             this.currentPage = (Math.ceil((this.totalCount / this.pageSize)));
        //             console.log("totalPage is " + (Math.ceil((this.totalCount / this.pageSize))))
        //             this.showAllAffair()
        //         },
        //         getDeletedData(id) {
        //             // const urlIdentifyId = new URLSearchParams()
        //             // urlIdentifyId.append('idR', id)
        //             axios.delete("/ScheduleBlock/deleteData", {params: {idR: id}}).then((res) => {
        //                 if (res.data == true) {
        //                     alert("delete success")
        //                 } else {
        //                     alert("delete failed")
        //                 }
        //
        //                 console.log("success")
        //                 this.showAllAffair()
        //             }).catch(err => {
        //                 console.log("failed")
        //
        //             })
        //         },
        //         queryUpdatedTarget(id) {
        //             console.log("queryUpdatedTarget is in")
        //             axios({
        //                 url: "/ScheduleBlock/queryUpdatedTarget",
        //                 method: "post",
        //                 params: {
        //                     idR: id,
        //                 },
        //                 header: {},
        //             }).then((res) => {
        //                 console.log("data is" + res.data)
        //                 this.schedule = res.data
        //                 console.log("this schedule is " + this.schedule)
        //                 console.log("success")
        //                 console.log("success, ready jump to update page")
        //                 //To convert the object data to json
        //                 const json = encodeURIComponent(JSON.stringify(this.schedule))
        //                 console.log(json)
        //                 const URLSend = "/ScheduleBlock/schedule/update?schedule=" + json;
        //                 // to make window.location.href to send a post request
        //                 const html = "<form action='" + URLSend + "' method='post' name='formSend' style='display:none'>"
        //                     + "</form>";
        //                 document.write(html);
        //                 document.formSend.submit();
        //             }).catch(err => {
        //                 console.log("failed")
        //             })
        //         }
        //     },
        //     mounted() {
        //         this.showAllAffair()
        //         this.contactFor()
        //         this.typeFor()
        //         this.locationFor()
        //         this.getTotalCount()
        //     },
        // },
        "Updateform": {
            template: "#UpdateForm",
            data() {
                return {
                    duration: ["1", "2", "3", "4"],
                    durationShowAndSend: "",
                    typeProps: [],
                    contactProps: [],
                    locationProps: [],
                    schedule: {
                        date: "",
                        time: "",
                        contact_id: "",
                        location: "",
                        type: "",
                        topic: "",
                        title: "",
                        duration: "",
                    },
                }
            },
            methods: {
                typeFor() {
                    axios({
                        url: "/ScheduleBlock/typeFor",
                        method: "post",
                        header: {},
                    }).then((res) => {
                        this.typeProps = res.data
                        console.log(res.data)
                        console.log(this.typeProps)
                        console.log("success")
                    }).catch(err => {
                        console.log("failed")
                    })
                },
                contactFor() {
                    axios({
                        url: "/ScheduleBlock/contactFor",
                        method: "post",
                        header: {},
                    }).then((res) => {
                        this.contactProps = res.data
                        console.log(this.contactProps)
                        console.log(res.data)
                        console.log("success")
                    }).catch(err => {
                        console.log("failed")
                    })
                },
                locationFor() {
                    axios({
                        url: "/ScheduleBlock/locationFor",
                        method: "post",
                        header: {},
                    }).then((res) => {
                        this.locationProps = res.data
                        console.log(this.locationProps)
                        console.log(res.data)
                        console.log("success")
                    }).catch(err => {
                        console.log("failed")
                    })
                },
                updateScheduleData(id) {

                    // if (this.schedule.contact_id == "Jhon") {
                    //     this.schedule.contact_id = 1
                    // } else if (this.contact_id == "Luna") {
                    //     this.schedule.contact_id = 2
                    // } else if (this.contact_id == "LUORUI") {
                    //     this.schedule.contact_id = 3
                    //     console.log("contact is " + this.contact_id)
                    // }
                    //
                    // if (this.schedule.type == "Depertment") {
                    //     this.schedule.type = 1
                    // } else if (this.schedule.type == "Company") {
                    //     this.schedule.type = 2
                    // } else if (this.schedule.type == "Org") {
                    //     this.schedule.type = 3
                    // }
                    //
                    // if (this.schedule.location == "ABuilding") {
                    //     this.schedule.location = 1
                    // } else if (this.schedule.location == "BBuilding") {
                    //     this.schedule.location = 2
                    // } else if (this.schedule.location == "CBuilding") {
                    //     this.schedule.location = 3
                    // }
                    console.log(this.schedule)
                    this.schedule.duration = this.durationShowAndSend
                    const urlParams = new URLSearchParams()
                    urlParams.append("schedule", JSON.stringify(this.schedule))
                    urlParams.append("idR", id)
                    axios.post("/ScheduleBlock/updateScheduleData", urlParams).then((res => {
                        if (res.data == true) {
                            layer.alert("Success")
                        } else {
                            layer.alert("Failed")
                        }
                        console.log("success")
                    })).catch(err => {
                        layer.alert("Failed")
                        console.log("failed")
                    });
                },
            },
            mounted() {
                this.typeFor()
                this.locationFor()
                this.contactFor()
            },

        }
    },
    methods: {
        getScheduleShow() {
            console.log("getScheduleShow")
            this.ScheduleShow = true;
            this.ScheduleManagementShow = false;
            this.AffairsShow = false;
            this.NotesShow = false;
            this.UpdateFormShow = false;
            $("#checkSchedule").css("background-color", "#f5d442")
            console.log(this.ScheduleShow)
        },
        getScheduleManagementShow() {
            console.log("getScheduleManagementShow")
            this.ScheduleShow = false;
            this.ScheduleManagementShow = true;
            this.AffairsShow = false;
            this.NotesShow = false;
            this.UpdateFormShow = false;
            console.log(this.ScheduleManagementShow)
        },
        getAffairsShow() {
            console.log("getAffairsShow")
            this.ScheduleShow = false;
            this.ScheduleManagementShow = false;
            this.AffairsShow = true;
            this.NotesShow = false;
            this.UpdateFormShow = false;
            console.log(this.AffairsShow)
        },
        getNotesShow() {
            this.ScheduleShow = false;
            this.ScheduleManagementShow = false;
            this.AffairsShow = false;
            this.NotesShow = true;
            this.UpdateFormShow = false;
            console.log(this.NotesShow)
        },
        getUpdateFormShow() {
            this.ScheduleShow = false;
            this.ScheduleManagementShow = false;
            this.AffairsShow = false;
            this.NotesShow = false;
            this.UpdateFormShow = true;
            console.log("this.UpdateFormShow" + this.UpdateFormShow)
        },


    }
})
router.push("/Affairs")